<template>
	<!-- 文档打印A4a3纸 单面 双面(长边翻转）  双面(短边翻转） -->
	<view class="flex" style="margin-top: 28rpx;margin-bottom: 40rpx;">
		<!-- 单面 -->
		<view class="colours" style="margin-right: 40rpx;" @click="DomFlag && selectlongface(0)" v-if="oneSideBoolean">
			<view :class="tabsele==0?'colours-yes':'colours-no'">
				<!-- 单面 -->
				<slot name="oneSide"></slot>
			</view>
			<image v-if="tabsele==0" src="@/static/index/selects@2x.png"></image>
		</view>
		<!-- 双面长边翻转 -->
		<view class="colours" @click="DomFlag &&  selectlongface(1)" v-if="longflipBoolean"
			style="margin-right: 40rpx;width: 216rpx;">
			<view :class="tabsele==1?'colours-yes':'colours-no'">
				<!-- 双面(长边翻转） -->
				<slot name="longflip" ref="longflip"></slot>
			</view>
			<image v-if="tabsele==1" src="@/static/index/selectslong.png">
			</image>
		</view>
		<!-- 双面短边翻转 -->
		<view class="colours" @click="DomFlag &&  selectlongface(2)" v-if="briefflipBoolean" style="width: 216rpx;">
			<view :class="tabsele==2?'colours-yes':'colours-no'">
				<!-- 双面(短边翻转） -->
				<slot name="briefflip" ref="briefflip"></slot>
			</view>
			<image v-if="tabsele==2" src="@/static/index/selectslong.png">
			</image>
		</view>
	</view>
</template>
<script>
	// clickFlag 是控制可不可以在点击sku的 和点击事件配合使用   有的时候选择完毕sku点击上传支付的时候  加载框在加载  这时候 sb用户在点击sku就不可以点击成功
	export default {
		// props: ["oneSide", "longflip", "briefflip", "clickFlag"],
		props: {
			oneSideBoolean: {
				type: Boolean,
				default: true,
			},
			longflipBoolean: {
				type: Boolean,
				default: true,
			},
			briefflipBoolean: {
				type: Boolean,
				default: true,
			},
			DomFlag: {
				type: Boolean,
				default: true,
			},


		},
		data() {
			return {
				tabsele: 0,
			}
		},
		methods: {
			selectlongface(index) {
				this.tabsele = index;
				this.$emit("selectlongface",index)
			}
		}
	}
</script>

<style>
	.colours {
		width: 142rpx;
		height: 62rpx;
		position: relative
	}

	.colours>view {
		position: absolute;
		width: 100%;
		line-height: 62rpx;
		text-align: center;
		font-size: 14px;
		font-family: PingFang-SC-Medium;
		font-weight: 500;
	}

	.colours>text {
		position: absolute;
		width: 100%;
		line-height: 62rpx;
		/* bottom: 0rpx;left: 0rpx; */
		text-align: center;
		font-size: 14px;
		font-family: PingFang-SC-Medium;
		font-weight: 500;
	}

	.colours-yes {
		color: #FE5734;
	}

	.colours-no {
		border: 1px solid #E7E6E9;
		border-radius: 5px;
		color: #222222;
	}
</style>
